<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<title>oauth-dropins | snarfed.org</title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="http://snarfed.org/w/xmlrpc.php" />
<!--[if lt IE 9]>
<script src="http://snarfed.org/w/wp-content/themes/ryu/js/html5.js" type="text/javascript"></script>
<![endif]-->

<link rel="alternate" type="application/rss+xml" title="snarfed.org &raquo; Feed" href="http://snarfed.org/feed" />
<link rel="alternate" type="application/rss+xml" title="snarfed.org &raquo; Comments Feed" href="http://snarfed.org/comments/feed" />
<link rel="alternate" type="application/rss+xml" title="snarfed.org &raquo; oauth-dropins Comments Feed" href="http://snarfed.org/2013-10-23_oauth-dropins/feed" />
<link rel='stylesheet' id='nextgen_gallery_related_images-css'  href='http://snarfed.org/w/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/nextgen_gallery_related_images.css?ver=3.7' type='text/css' media='all' />
<link rel='stylesheet' id='jetpack-widgets-css'  href='http://snarfed.org/w/wp-content/plugins/jetpack/modules/widgets/widgets.css?ver=20121003' type='text/css' media='all' />
<link rel='stylesheet' id='ryu-style-css'  href='http://snarfed.org/w/wp-content/themes/snarfed-ryu/style.css?ver=3.7' type='text/css' media='all' />
<link rel='stylesheet' id='ryu-lato-css'  href='http://fonts.googleapis.com/css?family=Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic' type='text/css' media='all' />
<link rel='stylesheet' id='ryu-playfair-display-css'  href='http://fonts.googleapis.com/css?family=Playfair+Display:400,700,900,400italic,700italic,900italic&#038;subset=latin,latin-ext' type='text/css' media='all' />
<script type='text/javascript' src='http://snarfed.org/w/wp-includes/js/jquery/jquery.js?ver=1.10.2'></script>
<script type='text/javascript' src='http://snarfed.org/w/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1'></script>
<script type='text/javascript'>
/* <![CDATA[ */
var photocrati_ajax = {"url":"http:\/\/snarfed.org\/photocrati_ajax","wp_site_url":"http:\/\/snarfed.org","wp_site_static_url":"http:\/\/snarfed.org\/w"};
/* ]]> */
</script>
<script type='text/javascript' src='http://snarfed.org/w/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/static/ajax.js?ver=3.7'></script>
<link rel='prev' title='RSVP: #Indieweb catchup' href='http://snarfed.org/2013-10-22_rsvp-indieweb-catchup' />

<link rel='canonical' href='http://snarfed.org/2013-10-23_oauth-dropins' />
<link rel='shortlink' href='http://wp.me/p3EDAq-1XE' />
<link rel="openid2.provider" href="https://www.google.com/accounts/o8/ud?source=profiles">
<link rel="openid2.local_id" href="http://www.google.com/profiles/heaven">
<link href="https://plus.google.com/103651231634018158746" rel="publisher" />
<meta property="fb:admins" content="212038" />

<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-11785301-1']);
  _gaq.push(['_trackPageview']);
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>

<!-- <meta name="NextGEN" version="2.0.33" /> -->
<link rel="http://webmention.org/" href="http://snarfed.org/w/?webmention=endpoint" />
<style type='text/css'>img#wpstats{display:none}</style>
<!-- Jetpack Open Graph Tags -->
<meta property="og:type" content="article" />
<meta property="og:title" content="oauth-dropins" />
<meta property="og:url" content="http://snarfed.org/2013-10-23_oauth-dropins" />
<meta property="og:description" content="Need to use an [OAuth](http://oauth.net/)-protected API in a Python webapp? [oauth-dropins](https://github.com/snarfed/oauth-dropins) is for you! It&#039;s a collection of drop-in OAuth client flows for..." />
<meta property="og:site_name" content="snarfed.org" />
<meta property="og:image" content="/oauth_shiny.png" />
<meta name="twitter:site" content="@snarfed_org" />
<meta name="twitter:image" content="/oauth_shiny.png" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:description" content="Need to use an [OAuth](http://oauth.net/)-protected API in a Python webapp? [oauth-dropins](https://github.com/snarfed/oauth-dropins) is for you! It&#039;s a collection of drop-in OAuth client flows for..." />
	<style type="text/css">
			.site-title,
		.site-description {
			position: absolute;
			clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
			clip: rect(1px, 1px, 1px, 1px);
		}
		.header-image {
			margin-bottom: 0;
		}
		</style>
			<link rel="stylesheet" id="custom-css-css" type="text/css" href="http://snarfed.org/?custom-css=1&#038;csblog=1&#038;cscache=6&#038;csrev=45" />
		</head>

<body class="single single-post postid-7542 single-format-standard h-entry hentry h-as-article">


<div id="page" class="site">
		<div id="widgets-wrapper" class="toppanel hide">
		<div id="secondary" role="complementary" class="wrap clear one">
		<div id="top-sidebar-one" class="widget-area" role="complementary">
		<aside id="text-2" class="widget widget_text">			<div class="textwidget"><div class="h-card vcard">
<div id="my-header">
I'm <a id="my-name" href="/about" class="p-name fn">Ryan Barrett</a>.<br />
I <a href="/house">live</a>, <a href="/resume">work</a>, and <a href="/pictures">play</a> in San Francisco.<br />
I <a href="/software">code</a>, <a href="/tag/essay">write</a>, and post <a href="/pictures">pictures</a> here.
</div>
<img class="u-photo photo" src="http://snarfed.org/ryan_profile_square_thumb.jpg" style="display: none" />

<ul id="my-icons">
  <li class="home-link">
    <a href="http://snarfed.org/" class="genericon url u-url" title="Home">
      <span class="screen-reader-text">Home</span>
    </a>
  </li>
  <li class="search-trigger">
    <a href="#" class="genericon" title="Search">
      <span class="screen-reader-text">Search</span>
    </a>
  </li>
  <li class="archives-link">
    <a href="/archive" class="genericon" title="Archives">
      <span class="screen-reader-text">Archives</span>
    </a>
  </li>
  <li class="twitter-link">
    <a rel="me" href="https://twitter.com/snarfed_org" class="genericon" title="Twitter" target="_blank">
      <span class="screen-reader-text">Twitter</span>
    </a>
  </li>
  <li class="facebook-link">
    <a rel="me" href="https://www.facebook.com/snarfed.org" class="genericon" title="Facebook" target="_blank">
      <span class="screen-reader-text">Facebook</span>
    </a>
  </li>
  <li class="google-link">
    <a rel="me" href="https://plus.google.com/103651231634018158746" class="genericon" title="Google+" target="_blank">
      <span class="screen-reader-text">Google+</span>
    </a>
  </li>
  <li class="github-link">
    <a rel="me" href="https://github.com/snarfed" class="genericon" title="GitHub" target="_blank">
      <span class="screen-reader-text">GitHub</span>
    </a>
  </li>
  <li class="feed-link">
    <a href="/feed" class="genericon" title="RSS Feed">
      <span class="screen-reader-text">RSS Feed</span>
    </a>
  </li>
</ul>
</div></div>
		</aside>	</div><!-- #first .widget-area -->
	
	
	
	</div><!-- #secondary -->	</div>
	
	
	<div id="search-wrapper" class="toppanel hide">
		
<form method="get" id="searchform" class="searchform" action="http://snarfed.org/" role="search">
	<label for="s" class="screen-reader-text">Search</label>
	<input type="search" class="field" name="s" value="" id="s" placeholder="Search &hellip;" />
	<input type="submit" class="submit" id="searchsubmit" value="Search" />
</form>	</div>

	<div id="triggers-wrapper">
		<ul class="triggers clear">
						<li class="widgets-trigger">
				<a href="#" class="genericon" title="Widgets">
					<span class="screen-reader-text">Widgets</span>
				</a>
			</li>
			
			
			<li class="search-trigger">
				<a href="#" class="genericon" title="Search">
					<span class="screen-reader-text">Search</span>
				</a>
			</li>
		</ul>
	</div>

	<header id="masthead" class="site-header" role="banner">
		<div class="wrap">
			
							<a class="site-logo"  href="http://snarfed.org/" title="snarfed.org" rel="home">
					<img src="http://snarfed.org/w/wp-content/uploads/2013/06/copy-cropped-iraq_bar.jpg" width="1500" height="213" alt="" class="no-grav header-image" />
				</a>
			
			<hgroup>
				<h1 class="site-title"><a href="http://snarfed.org/" title="snarfed.org" rel="home">snarfed.org</a></h1>
				<h2 class="site-description">Ryan Barrett&#039;s blog</h2>
			</hgroup>
		</div><!-- .wrap -->

			</header><!-- #masthead -->

	<div id="main" class="site-main">
	<div id="primary" class="content-area">
		<div id="content" class="site-content" role="main">

		
			
<article id="post-7542" class="post-7542 post type-post status-publish format-standard category-uncategorized clear">
	<div class="entry-wrap wrap clear">
		
		<header class="entry-header">
			<span class="categories-links"><a href="http://snarfed.org/category/uncategorized" title="View all posts in Uncategorized" rel="category tag">Uncategorized</a></span><h1 class="entry-title"><span class='p-name'>oauth-dropins</span></h1>		</header><!-- .entry-header -->

		<footer class="entry-meta">
			<span class="entry-date"><a href="http://snarfed.org/2013-10-23_oauth-dropins" title="10:32am" rel="bookmark"><time class="dt-published" datetime="2013-10-23T10:32:06+00:00">10/23/2013</time></a></span><span class="author h-card vcard"> <img alt='' src='http://1.gravatar.com/avatar/947b5f3f323da0ef785b6f02d9c265d6?s=96&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&amp;r=G' class='u-photo avatar avatar-96 photo' height='96' width='96' /><a class="u-url url fn n p-name" href="http://snarfed.org/" title="Ryan Barrett" rel="author">Ryan Barrett</a></span>
						<span class="comments-link"><a href="http://snarfed.org/2013-10-23_oauth-dropins#comments" title="Comment on oauth-dropins">1 Comment</a></span>
			
					</footer><!-- .entry-meta -->

				<div class="entry-content clear">
			<div class='e-content'><p class="third right">
<a href="https://oauth-dropins.appspot.com/"><img src="/oauth_shiny.png" /></a>
</p>

<p>Need to use an <a href="http://oauth.net/">OAuth</a>-protected API in a Python webapp?
<a href="https://github.com/snarfed/oauth-dropins">oauth-dropins</a> is for you! It&#8217;s a
collection of drop-in OAuth client flows for many popular sites. It supports
Facebook, Twitter, Google+, Instagram, Dropbox, Blogger, Tumblr, and
WordPress.com, with more on the way. It also currently requires
<a href="https://appengine.google.com/">Google App Engine</a>, but should support other
platforms in the future.</p>

<p><a href="https://oauth-dropins.appspot.com/">Try the demo!</a><span id="more-7542"></span><span /></p>

<p>You can use oauth-dropins in your project with just a bit of code. For example,
to use it for Facebook, just add these two lines to your WSGI application:</p>

<pre>
from oauth_dropins import facebook

application = webapp2.WSGIApplication([
  ...
  <b>('/facebook/start_oauth', facebook.StartHandler.to('/facebook/oauth_callback')),</b>
  <b>('/facebook/oauth_callback', facebook.CallbackHandler.to('/next'))</b>,
  ]
</pre>

<p>Then map those URLs in your
<a href="https://developers.google.com/appengine/docs/python/config/appconfig#Python_app_yaml_Script_handlers">app.yaml</a>
and put your <a href="https://developers.facebook.com/apps">Facebook app</a>&#8216;s key and
secret in <code>facebook_app_id</code> and <code>facebook_app_secret</code> files in your app&#8217;s root
directory, and you&#8217;re good to go!</p>

<p>See the <a href="https://github.com/snarfed/oauth-dropins">GitHub repo</a> for more
details. Happy hacking!</p>
</div>					</div><!-- .entry-content -->
		
		<span class="entry-format-badge genericon"><span class="screen-reader-text">Standard</span></span>
	</div><!-- .entry-wrap -->
</article><!-- #post-## -->
			
			
<div id="comments" class="comments-area">
	<div class="comments-wrap wrap">

					<h2 class="comments-title">
				One thought on &ldquo;<span>oauth-dropins</span>&rdquo;			</h2>

			
			<ol class="comment-list">
					<li class="comment even thread-even depth-1 p-comment h-entry" id="li-comment-783020">
		<article id="comment-783020" class="comment">
			<footer>
				<div class="comment-author vcard">
					<span class="comment-author-avatar"><img alt='' src='http://0.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=48' class='u-photo avatar avatar-48 photo avatar-default' height='48' width='48' /></span>
					<cite class="fn genericon"><a href='http://twitter.com/snarfed_org' rel='external nofollow' class='u-url url'>Ryan Barrett</a></cite> <span class="says">says:</span>				</div><!-- .comment-author .vcard -->
			</footer>

			<div class="comment-content">
				<div class='e-content p-name p-summary'><p>Need to use an OAuth-ed API in a Python webapp? oauth-dropins is for you! <a href="http://t.co/DHqkNf0OBX" rel="nofollow">http://t.co/DHqkNf0OBX</a> Try the demo: <a href="http://t.co/8Cg0GFAdDb" rel="nofollow">http://t.co/8Cg0GFAdDb</a> <cite><a href="http://twitter.com/snarfed_org/status/393075859000549376" rel="nofollow">via Twitter</a></cite></p>
</div>							</div>

			<div class="comment-meta commentmetadata">
				<a href="http://snarfed.org/2013-10-23_oauth-dropins#comment-783020"><time datetime="2013-10-23T11:20:24+00:00">
				10/23/2013 at 11:20am				</time></a>
											</div><!-- .comment-meta .commentmetadata -->
		</article><!-- #comment-## -->

	</li><!-- #comment-## -->
			</ol><!-- .comment-list -->

			
		
		
										<div id="respond" class="comment-respond">
				<h3 id="reply-title" class="comment-reply-title">Leave a Reply <small><a rel="nofollow" id="cancel-comment-reply-link" href="/2013-10-23_oauth-dropins#respond" style="display:none;">Cancel reply</a></small></h3>
									<form action="http://snarfed.org/w/wp-comments-post.php" method="post" id="commentform" class="comment-form">
																			<p class="comment-notes">Your email address will not be published.</p>							<p class="comment-form-author"><label for="author">Name</label> <input id="author" name="author" type="text" value="" size="30" /></p>
<p class="comment-form-email"><label for="email">Email</label> <input id="email" name="email" type="text" value="" size="30" /></p>
<p class="comment-form-url"><label for="url">Website</label> <input id="url" name="url" type="text" value="" size="30" /></p>
												<p class="comment-form-comment"><label for="comment">Comment</label> <textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>						<p class="form-allowed-tags">You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:  <code>&lt;a href=&quot;&quot; title=&quot;&quot;&gt; &lt;abbr title=&quot;&quot;&gt; &lt;acronym title=&quot;&quot;&gt; &lt;b&gt; &lt;blockquote cite=&quot;&quot;&gt; &lt;cite&gt; &lt;code&gt; &lt;del datetime=&quot;&quot;&gt; &lt;em&gt; &lt;i&gt; &lt;q cite=&quot;&quot;&gt; &lt;strike&gt; &lt;strong&gt; </code></p>						<p class="form-submit">
							<input name="submit" type="submit" id="submit" value="Post Comment" />
							<input type='hidden' name='comment_post_ID' value='7542' id='comment_post_ID' />
<input type='hidden' name='comment_parent' id='comment_parent' value='0' />
						</p>
						<p style="display: none;"><input type="hidden" id="akismet_comment_nonce" name="akismet_comment_nonce" value="9e21df4fc3" /></p>					</form>
							</div><!-- #respond -->
			
	</div><!-- .comments-wrap -->
</div><!-- #comments -->
		
		</div><!-- #content -->
	</div><!-- #primary -->


	</div><!-- #main -->

	<footer id="colophon" class="site-footer" role="contentinfo">
		<div class="site-info wrap">
						<a href="http://wordpress.org/" title="A Semantic Personal Publishing Platform" rel="generator">Proudly powered by WordPress</a>
			<span class="sep"> | </span>
			Theme: Ryu by <a href="http://automattic.com/" rel="designer">Automattic</a>.		</div><!-- .site-info -->
	</footer><!-- #colophon -->
</div><!-- #page -->

	<div style="display:none">
	<div class="grofile-hash-map-947b5f3f323da0ef785b6f02d9c265d6">
	</div>
	<div class="grofile-hash-map-d41d8cd98f00b204e9800998ecf8427e">
	</div>
	</div>

	<script src="http://stats.wordpress.com/e-201344.js" type="text/javascript"></script>
	<script type="text/javascript">
	st_go({v:'ext',j:'1:2.5',blog:'54014302',post:'7542',tz:'-7'});
	var load_cmc = function(){linktracker_init(54014302,7542,2);};
	if ( typeof addLoadEvent != 'undefined' ) addLoadEvent(load_cmc);
	else load_cmc();
	</script>
<script type='text/javascript' src='http://s0.wp.com/wp-content/js/devicepx-jetpack.js?ver=201344'></script>
<script type='text/javascript' src='http://s.gravatar.com/js/gprofiles.js?ver=2013Octaa'></script>
<script type='text/javascript'>
/* <![CDATA[ */
var WPGroHo = {"my_hash":""};
/* ]]> */
</script>
<script type='text/javascript' src='http://snarfed.org/w/wp-content/plugins/jetpack/modules/wpgroho.js?ver=3.7'></script>
<script type='text/javascript' src='http://snarfed.org/w/wp-content/themes/ryu/js/skip-link-focus-fix.js?ver=20130115'></script>
<script type='text/javascript' src='http://snarfed.org/w/wp-content/themes/ryu/js/ryu.js?ver=20130319'></script>
</body>
</html>
<!-- Dynamic page generated in 0.502 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2013-10-30 08:32:04 -->

<!-- Compression = gzip -->